In [1]:
import numpy as np
import pandas as pd
In [9]:
df = pd.DataFrame({'A':[1,2,np.nan],
'B':[5,np.nan,np.nan],
'C':[1,2,3]})
In [10]:
df
Out[10]:
In [12]:
df.dropna()
Out[12]:
In [13]:
df.dropna(axis=1)
Out[13]:
In [14]:
df.dropna(thresh=2)
Out[14]:
In [15]:
df.fillna(value='FILL VALUE')
Out[15]:
In [17]:
df['A'].fillna(value=df['A'].mean())
Out[17]: